import { PropsWithChildren } from 'react';
import { Form, FormInstance, Input } from 'antd';
import { Rule } from 'antd/lib/form';
import './form.less';
export function FormItem(props: PropsWithChildren<{labelName: string, isRequired?: boolean, name: string, rule?: Rule[]}>) {
    return (
        <div className="form-item">
            <label className="form-item-label">{props.labelName}</label>
            <div className="form-input-area">
                <Form.Item
                    name={props.name}
                    rules={props.rule}
                    validateFirst={true}
                >
                    {props.children}
                </Form.Item>
            </div>
        </div>
    );
}